<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Cate_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-cate_id"  data-source="deerhome/cate/selectpage" data-params='{"custom[cate_id]":"0"}' class="form-control selectpage" name="row[cate_id]" type="text" value="{$row.cate_id|htmlentities}">
            <input id="c-id" class="form-control hide" name="row[id]" type="number" value="{$row.id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Face_image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-face_image" class="form-control" size="50" name="row[face_image]" type="text" value="{$row.face_image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button"  data-params='{"category":"design"}' id="faupload-face_image" class="btn btn-danger faupload" data-input-id="c-face_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-face_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-face_image" class="btn btn-primary fachoose" data-input-id="c-face_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-face_image"></span>
            </div>
            <ul class="row list-inline faupload-preview" id="p-face_image"></ul>
        </div>
    </div>
    
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
            <div style="color:#666;font-size:13px;margin-top:5px;">*越小越靠前</div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">分类广告图:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-ad_image" class="form-control" size="50" name="row[ad_image]" type="text" value="{$row.ad_image|htmlentities}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="faupload-ad_image"  data-params='{"category":"design"}' class="btn btn-danger faupload" data-input-id="c-ad_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-ad_image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-ad_image" class="btn btn-primary fachoose" data-input-id="c-ad_image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-ad_image"></span>
            </div>
            <div style="color:#666;font-size:13px;margin-top:5px;">*只有顶级分类的广告才会展示</div>
            <ul class="deer-select-slide-box row list-inline faupload-preview" id="p-ad_image" data-template="desctpl" data-name="row[ad_image_ac]"></ul>
            <textarea name="row[ad_image_ac]"  class="form-control hidden" style="margin-top:5px;">{$row.ad_image_ac|htmlentities}</textarea>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<!--这里自定义图片预览的模板 开始-->
<script type="text/html" id="desctpl">
    <li class="col-xs-8" style="width:410px;height:310px;background-color: #e6e6e6;margin: 10px;padding:20px;">
        <a href="<%=fullurl%>" data-url="<%=url%>" target="_blank" class="thumbnail" style="width:370px;height:135px;">
            <img src="<%=fullurl%>" style="height:125px;" class="img-responsive">
        </a>
        <div class="input-group mb-1">
            <span class="input-group-addon" >点击事件</span>
            <select class="form-control deer-select-slide-change" name="tpl[<%=index%>][type]" >
                <option value="no">无</option>
                <option value="item" <%=(value?value['type']:'')=='item'?'selected':''%> >跳转商品</option>
                <option value="yhq" <%=(value?value['type']:'')=='yhq'?'selected':''%>>优惠券领取界面</option>
            </select>
        </div>
        <div class="input-group mb-1 deer-select-slide-change-items <%=(value?value['type']:'')=='item'?'':'hide-deer'%>">
            <span class="input-group-addon">ID</span>
            <input type="text" readonly  name="tpl[<%=index%>][id]"  placeholder="请选择" class="form-control form-control-id" value="<%=value?value['id']:''%>"/>
            <input type="text"  name="tpl[<%=index%>][desc]" class="form-control form-control-desc" placeholder="请选择" value="<%=value?value['desc']:''%>"/>
            
            <span class="input-group-addon btn-deer-dialog" style="cursor:pointer" data-urlpop="deerhome/design/items"  title="选择商品"> <i class="fa fa-hand-o-up"></i> 选择商品</span>
            
        </div>
        
        <a href="javascript:;" class="btn btn-xs btn-danger btn-trash" style="width:60px;"><i class="fa fa-trash"></i></a>
    </li>
</script>
<!--这里自定义图片预览的模板 结束-->
<style>
    .hide-deer{
        display: none;
    }
</style>